import type { MenuProps } from "antd";
import {
  AppstoreOutlined,
  UserOutlined,
  EditOutlined,
  BellOutlined,
  UserSwitchOutlined,
} from "@ant-design/icons";
import useAppStore from "@/store/appStore";

type MenuItem = Required<MenuProps>["items"][number];
export const items = (): MenuItem[] => {
  const { user } = useAppStore();
  return [
    {
      key: "/dashboard/message",
      label: "消息中心",
      icon: <BellOutlined />,
    },
    {
      key: "/member",
      label: user.username,
      icon: <UserOutlined />,
      children: [
        {
          key: "/dashboard/member",
          label: "个人中心",
          icon: <AppstoreOutlined />,
        },
        {
          key: "/dashboard/modify",
          label: "修改密码",
          icon: <EditOutlined />,
        },
        {
          key: "logOut",
          label: "退出登录",
          icon: <UserSwitchOutlined />,
        },
      ],
    },
  ];
};
